// Copyright (C) 2019-2020 star.engine at outlook dot com
//
// This file is part of StarEngine
//
// StarEngine is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// StarEngine is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with StarEngine.  If not, see <https://www.gnu.org/licenses/>.

#pragma once
#include <vulkan/vulkan.h>
#include <Star/Graphics/SRenderFormat.h>

namespace Star::Graphics::Render {

inline bool isVkFormat(Format format) noexcept {
    switch(format) {
    case Format::UNKNOWN:
    case Format::R64G64B64A64_UINT:
    case Format::R64G64B64A64_SINT:
    case Format::R64G64B64A64_SFLOAT:
    case Format::R64G64B64_UINT:
    case Format::R64G64B64_SINT:
    case Format::R64G64B64_SFLOAT:
    case Format::R32G32B32A32_UINT:
    case Format::R32G32B32A32_SINT:
    case Format::R32G32B32A32_SFLOAT:
    case Format::R64G64_UINT:
    case Format::R64G64_SINT:
    case Format::R64G64_SFLOAT:
    case Format::R32G32B32_UINT:
    case Format::R32G32B32_SINT:
    case Format::R32G32B32_SFLOAT:
    case Format::R16G16B16A16_UNORM:
    case Format::R16G16B16A16_SNORM:
    case Format::R16G16B16A16_USCALED:
    case Format::R16G16B16A16_SSCALED:
    case Format::R16G16B16A16_UINT:
    case Format::R16G16B16A16_SINT:
    case Format::R16G16B16A16_SFLOAT:
    case Format::R32G32_UINT:
    case Format::R32G32_SINT:
    case Format::R32G32_SFLOAT:
    case Format::R64_UINT:
    case Format::R64_SINT:
    case Format::R64_SFLOAT:
    case Format::R16G16B16_UNORM:
    case Format::R16G16B16_SNORM:
    case Format::R16G16B16_USCALED:
    case Format::R16G16B16_SSCALED:
    case Format::R16G16B16_UINT:
    case Format::R16G16B16_SINT:
    case Format::R16G16B16_SFLOAT:
    case Format::R10G10B10A2_UNORM_PACK32:
    case Format::R10G10B10A2_SNORM_PACK32:
    case Format::R10G10B10A2_USCALED_PACK32:
    case Format::R10G10B10A2_SSCALED_PACK32:
    case Format::R10G10B10A2_UINT_PACK32:
    case Format::R10G10B10A2_SINT_PACK32:
    case Format::B10G10R10A2_UNORM_PACK32:
    case Format::B10G10R10A2_SNORM_PACK32:
    case Format::B10G10R10A2_USCALED_PACK32:
    case Format::B10G10R10A2_SSCALED_PACK32:
    case Format::B10G10R10A2_UINT_PACK32:
    case Format::B10G10R10A2_SINT_PACK32:
    case Format::R9G9B9E5_UFLOAT_PACK32:
    case Format::R8G8B8A8_UNORM:
    case Format::R8G8B8A8_UNORM_PACK32:
    case Format::R8G8B8A8_SNORM:
    case Format::R8G8B8A8_SNORM_PACK32:
    case Format::R8G8B8A8_USCALED:
    case Format::R8G8B8A8_USCALED_PACK32:
    case Format::R8G8B8A8_SSCALED:
    case Format::R8G8B8A8_SSCALED_PACK32:
    case Format::R8G8B8A8_UINT:
    case Format::R8G8B8A8_UINT_PACK32:
    case Format::R8G8B8A8_SINT:
    case Format::R8G8B8A8_SINT_PACK32:
    case Format::R8G8B8A8_SRGB:
    case Format::R8G8B8A8_SRGB_PACK32:
    case Format::B8G8R8A8_UNORM:
    case Format::B8G8R8A8_SNORM:
    case Format::B8G8R8A8_USCALED:
    case Format::B8G8R8A8_SSCALED:
    case Format::B8G8R8A8_UINT:
    case Format::B8G8R8A8_SINT:
    case Format::B8G8R8A8_SRGB:
    case Format::R11G11B10_UFLOAT_PACK32:
    case Format::R16G16_UNORM:
    case Format::R16G16_SNORM:
    case Format::R16G16_USCALED:
    case Format::R16G16_SSCALED:
    case Format::R16G16_UINT:
    case Format::R16G16_SINT:
    case Format::R16G16_SFLOAT:
    case Format::R32_UINT:
    case Format::R32_SINT:
    case Format::R32_SFLOAT:
    case Format::R8G8B8_UNORM:
    case Format::R8G8B8_SNORM:
    case Format::R8G8B8_USCALED:
    case Format::R8G8B8_SSCALED:
    case Format::R8G8B8_UINT:
    case Format::R8G8B8_SINT:
    case Format::R8G8B8_SRGB:
    case Format::B8G8R8_UNORM:
    case Format::B8G8R8_SNORM:
    case Format::B8G8R8_USCALED:
    case Format::B8G8R8_SSCALED:
    case Format::B8G8R8_UINT:
    case Format::B8G8R8_SINT:
    case Format::B8G8R8_SRGB:
    case Format::B5G5R5A1_UNORM_PACK16:
    case Format::A1B5G5R5_UNORM_PACK16:
    case Format::A1R5G5B5_UNORM_PACK16:
    case Format::A4B4G4R4_UNORM_PACK16:
    case Format::A4R4G4B4_UNORM_PACK16:
    case Format::R5G6B5_UNORM_PACK16:
    case Format::B5G6R5_UNORM_PACK16:
    case Format::R8G8_UNORM:
    case Format::R8G8_SNORM:
    case Format::R8G8_USCALED:
    case Format::R8G8_SSCALED:
    case Format::R8G8_UINT:
    case Format::R8G8_SINT:
    case Format::R8G8_SRGB:
    case Format::R16_UNORM:
    case Format::R16_SNORM:
    case Format::R16_USCALED:
    case Format::R16_SSCALED:
    case Format::R16_UINT:
    case Format::R16_SINT:
    case Format::R16_SFLOAT:
    case Format::G4R4_UNORM_PACK8:
    case Format::R8_UNORM:
    case Format::R8_SNORM:
    case Format::R8_USCALED:
    case Format::R8_SSCALED:
    case Format::R8_UINT:
    case Format::R8_SINT:
    case Format::R8_SRGB:
    case Format::D32_SFLOAT_S8_UINT:
    case Format::D24_UNORM_S8_UINT:
    case Format::D24_UNORM_X8_TYPELESS_PACK32:
    case Format::D32_SFLOAT:
    case Format::D16_UNORM_S8_UINT:
    case Format::D16_UNORM:
    case Format::S8_UINT:
    case Format::BC1_RGBA_UNORM_BLOCK:
    case Format::BC1_RGBA_SRGB_BLOCK:
    case Format::BC1_UNORM_BLOCK:
    case Format::BC1_SRGB_BLOCK:
    case Format::BC2_UNORM_BLOCK:
    case Format::BC2_SRGB_BLOCK:
    case Format::BC3_UNORM_BLOCK:
    case Format::BC3_SRGB_BLOCK:
    case Format::BC4_UNORM_BLOCK:
    case Format::BC4_SNORM_BLOCK:
    case Format::BC5_UNORM_BLOCK:
    case Format::BC5_SNORM_BLOCK:
    case Format::BC6H_UFLOAT_BLOCK:
    case Format::BC6H_SFLOAT_BLOCK:
    case Format::BC7_UNORM_BLOCK:
    case Format::BC7_SRGB_BLOCK:
    case Format::ETC2_R8G8B8A8_UNORM_BLOCK:
    case Format::ETC2_R8G8B8A8_SRGB_BLOCK:
    case Format::ETC2_R8G8B8A1_UNORM_BLOCK:
    case Format::ETC2_R8G8B8A1_SRGB_BLOCK:
    case Format::ETC2_R8G8B8_UNORM_BLOCK:
    case Format::ETC2_R8G8B8_SRGB_BLOCK:
    case Format::EAC_R11G11_UNORM_BLOCK:
    case Format::EAC_R11G11_SNORM_BLOCK:
    case Format::EAC_R11_UNORM_BLOCK:
    case Format::EAC_R11_SNORM_BLOCK:
    case Format::ASTC_4x4_UNORM_BLOCK:
    case Format::ASTC_4x4_SRGB_BLOCK:
    case Format::ASTC_5x4_UNORM_BLOCK:
    case Format::ASTC_5x4_SRGB_BLOCK:
    case Format::ASTC_5x5_UNORM_BLOCK:
    case Format::ASTC_5x5_SRGB_BLOCK:
    case Format::ASTC_6x5_UNORM_BLOCK:
    case Format::ASTC_6x5_SRGB_BLOCK:
    case Format::ASTC_6x6_UNORM_BLOCK:
    case Format::ASTC_6x6_SRGB_BLOCK:
    case Format::ASTC_8x5_UNORM_BLOCK:
    case Format::ASTC_8x5_SRGB_BLOCK:
    case Format::ASTC_8x6_UNORM_BLOCK:
    case Format::ASTC_8x6_SRGB_BLOCK:
    case Format::ASTC_8x8_UNORM_BLOCK:
    case Format::ASTC_8x8_SRGB_BLOCK:
    case Format::ASTC_10x5_UNORM_BLOCK:
    case Format::ASTC_10x5_SRGB_BLOCK:
    case Format::ASTC_10x6_UNORM_BLOCK:
    case Format::ASTC_10x6_SRGB_BLOCK:
    case Format::ASTC_10x8_UNORM_BLOCK:
    case Format::ASTC_10x8_SRGB_BLOCK:
    case Format::ASTC_10x10_UNORM_BLOCK:
    case Format::ASTC_10x10_SRGB_BLOCK:
    case Format::ASTC_12x10_UNORM_BLOCK:
    case Format::ASTC_12x10_SRGB_BLOCK:
    case Format::ASTC_12x12_UNORM_BLOCK:
    case Format::ASTC_12x12_SRGB_BLOCK:
    case Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16:
    case Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16:
    case Format::R12X4G12X4_UNORM_2PACK16:
    case Format::R10X6G10X6_UNORM_2PACK16:
    case Format::R12X4_UNORM_PACK16:
    case Format::R10X6_UNORM_PACK16:
    case Format::G16B16_G16R16_422_UNORM:
    case Format::G12X4B12X4_G12X4R12X4_422_UNORM_4PACK16:
    case Format::G10X6B10X6_G10X6R10X6_422_UNORM_4PACK16:
    case Format::G8B8_G8R8_422_UNORM:
    case Format::B16G16_R16G16_422_UNORM:
    case Format::B12X4G12X4_R12X4G12X4_422_UNORM_4PACK16:
    case Format::B10X6G10X6_R10X6G10X6_422_UNORM_4PACK16:
    case Format::B8G8_R8G8_422_UNORM:
    case Format::G16_B16_R16_3PLANE_444_UNORM:
    case Format::G16_B16_R16_3PLANE_422_UNORM:
    case Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:
    case Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:
    case Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:
    case Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:
    case Format::G16_B16_R16_3PLANE_420_UNORM:
    case Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:
    case Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:
    case Format::G8_B8_R8_3PLANE_444_UNORM:
    case Format::G8_B8_R8_3PLANE_422_UNORM:
    case Format::G8_B8_R8_3PLANE_420_UNORM:
    case Format::G16_B16R16_2PLANE_422_UNORM:
    case Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:
    case Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:
    case Format::G16_B16R16_2PLANE_420_UNORM:
    case Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:
    case Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:
    case Format::G8_B8R8_2PLANE_422_UNORM:
    case Format::G8_B8R8_2PLANE_420_UNORM:
    case Format::PVRTC1_4BPP_UNORM_BLOCK_IMG:
    case Format::PVRTC1_4BPP_SRGB_BLOCK_IMG:
    case Format::PVRTC1_2BPP_UNORM_BLOCK_IMG:
    case Format::PVRTC1_2BPP_SRGB_BLOCK_IMG:
    case Format::PVRTC2_4BPP_UNORM_BLOCK_IMG:
    case Format::PVRTC2_4BPP_SRGB_BLOCK_IMG:
    case Format::PVRTC2_2BPP_UNORM_BLOCK_IMG:
    case Format::PVRTC2_2BPP_SRGB_BLOCK_IMG:
        return true;
    default:
        return false;
    }
}

inline VkFormat getVkFormat(Format format) noexcept {
    switch(format) {
    case Format::UNKNOWN: return VK_FORMAT_UNDEFINED;
    case Format::R64G64B64A64_UINT: return VK_FORMAT_R64G64B64A64_UINT;
    case Format::R64G64B64A64_SINT: return VK_FORMAT_R64G64B64A64_SINT;
    case Format::R64G64B64A64_SFLOAT: return VK_FORMAT_R64G64B64A64_SFLOAT;
    case Format::R64G64B64_UINT: return VK_FORMAT_R64G64B64_UINT;
    case Format::R64G64B64_SINT: return VK_FORMAT_R64G64B64_SINT;
    case Format::R64G64B64_SFLOAT: return VK_FORMAT_R64G64B64_SFLOAT;
    case Format::R32G32B32A32_UINT: return VK_FORMAT_R32G32B32A32_UINT;
    case Format::R32G32B32A32_SINT: return VK_FORMAT_R32G32B32A32_SINT;
    case Format::R32G32B32A32_SFLOAT: return VK_FORMAT_R32G32B32A32_SFLOAT;
    case Format::R64G64_UINT: return VK_FORMAT_R64G64_UINT;
    case Format::R64G64_SINT: return VK_FORMAT_R64G64_SINT;
    case Format::R64G64_SFLOAT: return VK_FORMAT_R64G64_SFLOAT;
    case Format::R32G32B32_UINT: return VK_FORMAT_R32G32B32_UINT;
    case Format::R32G32B32_SINT: return VK_FORMAT_R32G32B32_SINT;
    case Format::R32G32B32_SFLOAT: return VK_FORMAT_R32G32B32_SFLOAT;
    case Format::R16G16B16A16_UNORM: return VK_FORMAT_R16G16B16A16_UNORM;
    case Format::R16G16B16A16_SNORM: return VK_FORMAT_R16G16B16A16_SNORM;
    case Format::R16G16B16A16_USCALED: return VK_FORMAT_R16G16B16A16_USCALED;
    case Format::R16G16B16A16_SSCALED: return VK_FORMAT_R16G16B16A16_SSCALED;
    case Format::R16G16B16A16_UINT: return VK_FORMAT_R16G16B16A16_UINT;
    case Format::R16G16B16A16_SINT: return VK_FORMAT_R16G16B16A16_SINT;
    case Format::R16G16B16A16_SFLOAT: return VK_FORMAT_R16G16B16A16_SFLOAT;
    case Format::R32G32_UINT: return VK_FORMAT_R32G32_UINT;
    case Format::R32G32_SINT: return VK_FORMAT_R32G32_SINT;
    case Format::R32G32_SFLOAT: return VK_FORMAT_R32G32_SFLOAT;
    case Format::R64_UINT: return VK_FORMAT_R64_UINT;
    case Format::R64_SINT: return VK_FORMAT_R64_SINT;
    case Format::R64_SFLOAT: return VK_FORMAT_R64_SFLOAT;
    case Format::R16G16B16_UNORM: return VK_FORMAT_R16G16B16_UNORM;
    case Format::R16G16B16_SNORM: return VK_FORMAT_R16G16B16_SNORM;
    case Format::R16G16B16_USCALED: return VK_FORMAT_R16G16B16_USCALED;
    case Format::R16G16B16_SSCALED: return VK_FORMAT_R16G16B16_SSCALED;
    case Format::R16G16B16_UINT: return VK_FORMAT_R16G16B16_UINT;
    case Format::R16G16B16_SINT: return VK_FORMAT_R16G16B16_SINT;
    case Format::R16G16B16_SFLOAT: return VK_FORMAT_R16G16B16_SFLOAT;
    case Format::R10G10B10A2_UNORM_PACK32: return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
    case Format::R10G10B10A2_SNORM_PACK32: return VK_FORMAT_A2B10G10R10_SNORM_PACK32;
    case Format::R10G10B10A2_USCALED_PACK32: return VK_FORMAT_A2B10G10R10_USCALED_PACK32;
    case Format::R10G10B10A2_SSCALED_PACK32: return VK_FORMAT_A2B10G10R10_SSCALED_PACK32;
    case Format::R10G10B10A2_UINT_PACK32: return VK_FORMAT_A2B10G10R10_UINT_PACK32;
    case Format::R10G10B10A2_SINT_PACK32: return VK_FORMAT_A2B10G10R10_SINT_PACK32;
    case Format::B10G10R10A2_UNORM_PACK32: return VK_FORMAT_A2R10G10B10_UNORM_PACK32;
    case Format::B10G10R10A2_SNORM_PACK32: return VK_FORMAT_A2R10G10B10_SNORM_PACK32;
    case Format::B10G10R10A2_USCALED_PACK32: return VK_FORMAT_A2R10G10B10_USCALED_PACK32;
    case Format::B10G10R10A2_SSCALED_PACK32: return VK_FORMAT_A2R10G10B10_SSCALED_PACK32;
    case Format::B10G10R10A2_UINT_PACK32: return VK_FORMAT_A2R10G10B10_UINT_PACK32;
    case Format::B10G10R10A2_SINT_PACK32: return VK_FORMAT_A2R10G10B10_SINT_PACK32;
    case Format::R9G9B9E5_UFLOAT_PACK32: return VK_FORMAT_E5B9G9R9_UFLOAT_PACK32;
    case Format::R8G8B8A8_UNORM: return VK_FORMAT_R8G8B8A8_UNORM;
    case Format::R8G8B8A8_UNORM_PACK32: return VK_FORMAT_A8B8G8R8_UNORM_PACK32;
    case Format::R8G8B8A8_SNORM: return VK_FORMAT_R8G8B8A8_SNORM;
    case Format::R8G8B8A8_SNORM_PACK32: return VK_FORMAT_A8B8G8R8_SNORM_PACK32;
    case Format::R8G8B8A8_USCALED: return VK_FORMAT_R8G8B8A8_USCALED;
    case Format::R8G8B8A8_USCALED_PACK32: return VK_FORMAT_A8B8G8R8_USCALED_PACK32;
    case Format::R8G8B8A8_SSCALED: return VK_FORMAT_R8G8B8A8_SSCALED;
    case Format::R8G8B8A8_SSCALED_PACK32: return VK_FORMAT_A8B8G8R8_SSCALED_PACK32;
    case Format::R8G8B8A8_UINT: return VK_FORMAT_R8G8B8A8_UINT;
    case Format::R8G8B8A8_UINT_PACK32: return VK_FORMAT_A8B8G8R8_UINT_PACK32;
    case Format::R8G8B8A8_SINT: return VK_FORMAT_R8G8B8A8_SINT;
    case Format::R8G8B8A8_SINT_PACK32: return VK_FORMAT_A8B8G8R8_SINT_PACK32;
    case Format::R8G8B8A8_SRGB: return VK_FORMAT_R8G8B8A8_SRGB;
    case Format::R8G8B8A8_SRGB_PACK32: return VK_FORMAT_A8B8G8R8_SRGB_PACK32;
    case Format::B8G8R8A8_UNORM: return VK_FORMAT_B8G8R8A8_UNORM;
    case Format::B8G8R8A8_SNORM: return VK_FORMAT_B8G8R8A8_SNORM;
    case Format::B8G8R8A8_USCALED: return VK_FORMAT_B8G8R8A8_USCALED;
    case Format::B8G8R8A8_SSCALED: return VK_FORMAT_B8G8R8A8_SSCALED;
    case Format::B8G8R8A8_UINT: return VK_FORMAT_B8G8R8A8_UINT;
    case Format::B8G8R8A8_SINT: return VK_FORMAT_B8G8R8A8_SINT;
    case Format::B8G8R8A8_SRGB: return VK_FORMAT_B8G8R8A8_SRGB;
    case Format::R11G11B10_UFLOAT_PACK32: return VK_FORMAT_B10G11R11_UFLOAT_PACK32;
    case Format::R16G16_UNORM: return VK_FORMAT_R16G16_UNORM;
    case Format::R16G16_SNORM: return VK_FORMAT_R16G16_SNORM;
    case Format::R16G16_USCALED: return VK_FORMAT_R16G16_USCALED;
    case Format::R16G16_SSCALED: return VK_FORMAT_R16G16_SSCALED;
    case Format::R16G16_UINT: return VK_FORMAT_R16G16_UINT;
    case Format::R16G16_SINT: return VK_FORMAT_R16G16_SINT;
    case Format::R16G16_SFLOAT: return VK_FORMAT_R16G16_SFLOAT;
    case Format::R32_UINT: return VK_FORMAT_R32_UINT;
    case Format::R32_SINT: return VK_FORMAT_R32_SINT;
    case Format::R32_SFLOAT: return VK_FORMAT_R32_SFLOAT;
    case Format::R8G8B8_UNORM: return VK_FORMAT_R8G8B8_UNORM;
    case Format::R8G8B8_SNORM: return VK_FORMAT_R8G8B8_SNORM;
    case Format::R8G8B8_USCALED: return VK_FORMAT_R8G8B8_USCALED;
    case Format::R8G8B8_SSCALED: return VK_FORMAT_R8G8B8_SSCALED;
    case Format::R8G8B8_UINT: return VK_FORMAT_R8G8B8_UINT;
    case Format::R8G8B8_SINT: return VK_FORMAT_R8G8B8_SINT;
    case Format::R8G8B8_SRGB: return VK_FORMAT_R8G8B8_SRGB;
    case Format::B8G8R8_UNORM: return VK_FORMAT_B8G8R8_UNORM;
    case Format::B8G8R8_SNORM: return VK_FORMAT_B8G8R8_SNORM;
    case Format::B8G8R8_USCALED: return VK_FORMAT_B8G8R8_USCALED;
    case Format::B8G8R8_SSCALED: return VK_FORMAT_B8G8R8_SSCALED;
    case Format::B8G8R8_UINT: return VK_FORMAT_B8G8R8_UINT;
    case Format::B8G8R8_SINT: return VK_FORMAT_B8G8R8_SINT;
    case Format::B8G8R8_SRGB: return VK_FORMAT_B8G8R8_SRGB;
    case Format::B5G5R5A1_UNORM_PACK16: return VK_FORMAT_A1R5G5B5_UNORM_PACK16;
    case Format::A1B5G5R5_UNORM_PACK16: return VK_FORMAT_R5G5B5A1_UNORM_PACK16;
    case Format::A1R5G5B5_UNORM_PACK16: return VK_FORMAT_B5G5R5A1_UNORM_PACK16;
    case Format::A4B4G4R4_UNORM_PACK16: return VK_FORMAT_R4G4B4A4_UNORM_PACK16;
    case Format::A4R4G4B4_UNORM_PACK16: return VK_FORMAT_B4G4R4A4_UNORM_PACK16;
    case Format::R5G6B5_UNORM_PACK16: return VK_FORMAT_B5G6R5_UNORM_PACK16;
    case Format::B5G6R5_UNORM_PACK16: return VK_FORMAT_R5G6B5_UNORM_PACK16;
    case Format::R8G8_UNORM: return VK_FORMAT_R8G8_UNORM;
    case Format::R8G8_SNORM: return VK_FORMAT_R8G8_SNORM;
    case Format::R8G8_USCALED: return VK_FORMAT_R8G8_USCALED;
    case Format::R8G8_SSCALED: return VK_FORMAT_R8G8_SSCALED;
    case Format::R8G8_UINT: return VK_FORMAT_R8G8_UINT;
    case Format::R8G8_SINT: return VK_FORMAT_R8G8_SINT;
    case Format::R8G8_SRGB: return VK_FORMAT_R8G8_SRGB;
    case Format::R16_UNORM: return VK_FORMAT_R16_UNORM;
    case Format::R16_SNORM: return VK_FORMAT_R16_SNORM;
    case Format::R16_USCALED: return VK_FORMAT_R16_USCALED;
    case Format::R16_SSCALED: return VK_FORMAT_R16_SSCALED;
    case Format::R16_UINT: return VK_FORMAT_R16_UINT;
    case Format::R16_SINT: return VK_FORMAT_R16_SINT;
    case Format::R16_SFLOAT: return VK_FORMAT_R16_SFLOAT;
    case Format::G4R4_UNORM_PACK8: return VK_FORMAT_R4G4_UNORM_PACK8;
    case Format::R8_UNORM: return VK_FORMAT_R8_UNORM;
    case Format::R8_SNORM: return VK_FORMAT_R8_SNORM;
    case Format::R8_USCALED: return VK_FORMAT_R8_USCALED;
    case Format::R8_SSCALED: return VK_FORMAT_R8_SSCALED;
    case Format::R8_UINT: return VK_FORMAT_R8_UINT;
    case Format::R8_SINT: return VK_FORMAT_R8_SINT;
    case Format::R8_SRGB: return VK_FORMAT_R8_SRGB;
    case Format::D32_SFLOAT_S8_UINT: return VK_FORMAT_D32_SFLOAT_S8_UINT;
    case Format::D24_UNORM_S8_UINT: return VK_FORMAT_D24_UNORM_S8_UINT;
    case Format::D24_UNORM_X8_TYPELESS_PACK32: return VK_FORMAT_X8_D24_UNORM_PACK32;
    case Format::D32_SFLOAT: return VK_FORMAT_D32_SFLOAT;
    case Format::D16_UNORM_S8_UINT: return VK_FORMAT_D16_UNORM_S8_UINT;
    case Format::D16_UNORM: return VK_FORMAT_D16_UNORM;
    case Format::S8_UINT: return VK_FORMAT_S8_UINT;
    case Format::BC1_RGBA_UNORM_BLOCK: return VK_FORMAT_BC1_RGBA_UNORM_BLOCK;
    case Format::BC1_RGBA_SRGB_BLOCK: return VK_FORMAT_BC1_RGBA_SRGB_BLOCK;
    case Format::BC1_UNORM_BLOCK: return VK_FORMAT_BC1_RGB_UNORM_BLOCK;
    case Format::BC1_SRGB_BLOCK: return VK_FORMAT_BC1_RGB_SRGB_BLOCK;
    case Format::BC2_UNORM_BLOCK: return VK_FORMAT_BC2_UNORM_BLOCK;
    case Format::BC2_SRGB_BLOCK: return VK_FORMAT_BC2_SRGB_BLOCK;
    case Format::BC3_UNORM_BLOCK: return VK_FORMAT_BC3_UNORM_BLOCK;
    case Format::BC3_SRGB_BLOCK: return VK_FORMAT_BC3_SRGB_BLOCK;
    case Format::BC4_UNORM_BLOCK: return VK_FORMAT_BC4_UNORM_BLOCK;
    case Format::BC4_SNORM_BLOCK: return VK_FORMAT_BC4_SNORM_BLOCK;
    case Format::BC5_UNORM_BLOCK: return VK_FORMAT_BC5_UNORM_BLOCK;
    case Format::BC5_SNORM_BLOCK: return VK_FORMAT_BC5_SNORM_BLOCK;
    case Format::BC6H_UFLOAT_BLOCK: return VK_FORMAT_BC6H_UFLOAT_BLOCK;
    case Format::BC6H_SFLOAT_BLOCK: return VK_FORMAT_BC6H_SFLOAT_BLOCK;
    case Format::BC7_UNORM_BLOCK: return VK_FORMAT_BC7_UNORM_BLOCK;
    case Format::BC7_SRGB_BLOCK: return VK_FORMAT_BC7_SRGB_BLOCK;
    case Format::ETC2_R8G8B8A8_UNORM_BLOCK: return VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK;
    case Format::ETC2_R8G8B8A8_SRGB_BLOCK: return VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK;
    case Format::ETC2_R8G8B8A1_UNORM_BLOCK: return VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK;
    case Format::ETC2_R8G8B8A1_SRGB_BLOCK: return VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK;
    case Format::ETC2_R8G8B8_UNORM_BLOCK: return VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
    case Format::ETC2_R8G8B8_SRGB_BLOCK: return VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK;
    case Format::EAC_R11G11_UNORM_BLOCK: return VK_FORMAT_EAC_R11G11_UNORM_BLOCK;
    case Format::EAC_R11G11_SNORM_BLOCK: return VK_FORMAT_EAC_R11G11_SNORM_BLOCK;
    case Format::EAC_R11_UNORM_BLOCK: return VK_FORMAT_EAC_R11_UNORM_BLOCK;
    case Format::EAC_R11_SNORM_BLOCK: return VK_FORMAT_EAC_R11_SNORM_BLOCK;
    case Format::ASTC_4x4_UNORM_BLOCK: return VK_FORMAT_ASTC_4x4_UNORM_BLOCK;
    case Format::ASTC_4x4_SRGB_BLOCK: return VK_FORMAT_ASTC_4x4_SRGB_BLOCK;
    case Format::ASTC_5x4_UNORM_BLOCK: return VK_FORMAT_ASTC_5x4_UNORM_BLOCK;
    case Format::ASTC_5x4_SRGB_BLOCK: return VK_FORMAT_ASTC_5x4_SRGB_BLOCK;
    case Format::ASTC_5x5_UNORM_BLOCK: return VK_FORMAT_ASTC_5x5_UNORM_BLOCK;
    case Format::ASTC_5x5_SRGB_BLOCK: return VK_FORMAT_ASTC_5x5_SRGB_BLOCK;
    case Format::ASTC_6x5_UNORM_BLOCK: return VK_FORMAT_ASTC_6x5_UNORM_BLOCK;
    case Format::ASTC_6x5_SRGB_BLOCK: return VK_FORMAT_ASTC_6x5_SRGB_BLOCK;
    case Format::ASTC_6x6_UNORM_BLOCK: return VK_FORMAT_ASTC_6x6_UNORM_BLOCK;
    case Format::ASTC_6x6_SRGB_BLOCK: return VK_FORMAT_ASTC_6x6_SRGB_BLOCK;
    case Format::ASTC_8x5_UNORM_BLOCK: return VK_FORMAT_ASTC_8x5_UNORM_BLOCK;
    case Format::ASTC_8x5_SRGB_BLOCK: return VK_FORMAT_ASTC_8x5_SRGB_BLOCK;
    case Format::ASTC_8x6_UNORM_BLOCK: return VK_FORMAT_ASTC_8x6_UNORM_BLOCK;
    case Format::ASTC_8x6_SRGB_BLOCK: return VK_FORMAT_ASTC_8x6_SRGB_BLOCK;
    case Format::ASTC_8x8_UNORM_BLOCK: return VK_FORMAT_ASTC_8x8_UNORM_BLOCK;
    case Format::ASTC_8x8_SRGB_BLOCK: return VK_FORMAT_ASTC_8x8_SRGB_BLOCK;
    case Format::ASTC_10x5_UNORM_BLOCK: return VK_FORMAT_ASTC_10x5_UNORM_BLOCK;
    case Format::ASTC_10x5_SRGB_BLOCK: return VK_FORMAT_ASTC_10x5_SRGB_BLOCK;
    case Format::ASTC_10x6_UNORM_BLOCK: return VK_FORMAT_ASTC_10x6_UNORM_BLOCK;
    case Format::ASTC_10x6_SRGB_BLOCK: return VK_FORMAT_ASTC_10x6_SRGB_BLOCK;
    case Format::ASTC_10x8_UNORM_BLOCK: return VK_FORMAT_ASTC_10x8_UNORM_BLOCK;
    case Format::ASTC_10x8_SRGB_BLOCK: return VK_FORMAT_ASTC_10x8_SRGB_BLOCK;
    case Format::ASTC_10x10_UNORM_BLOCK: return VK_FORMAT_ASTC_10x10_UNORM_BLOCK;
    case Format::ASTC_10x10_SRGB_BLOCK: return VK_FORMAT_ASTC_10x10_SRGB_BLOCK;
    case Format::ASTC_12x10_UNORM_BLOCK: return VK_FORMAT_ASTC_12x10_UNORM_BLOCK;
    case Format::ASTC_12x10_SRGB_BLOCK: return VK_FORMAT_ASTC_12x10_SRGB_BLOCK;
    case Format::ASTC_12x12_UNORM_BLOCK: return VK_FORMAT_ASTC_12x12_UNORM_BLOCK;
    case Format::ASTC_12x12_SRGB_BLOCK: return VK_FORMAT_ASTC_12x12_SRGB_BLOCK;
    case Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16: return VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16;
    case Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16: return VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16;
    case Format::R12X4G12X4_UNORM_2PACK16: return VK_FORMAT_R12X4G12X4_UNORM_2PACK16;
    case Format::R10X6G10X6_UNORM_2PACK16: return VK_FORMAT_R10X6G10X6_UNORM_2PACK16;
    case Format::R12X4_UNORM_PACK16: return VK_FORMAT_R12X4_UNORM_PACK16;
    case Format::R10X6_UNORM_PACK16: return VK_FORMAT_R10X6_UNORM_PACK16;
    case Format::G16B16_G16R16_422_UNORM: return VK_FORMAT_G16B16G16R16_422_UNORM;
    case Format::G12X4B12X4_G12X4R12X4_422_UNORM_4PACK16: return VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16;
    case Format::G10X6B10X6_G10X6R10X6_422_UNORM_4PACK16: return VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16;
    case Format::G8B8_G8R8_422_UNORM: return VK_FORMAT_G8B8G8R8_422_UNORM;
    case Format::B16G16_R16G16_422_UNORM: return VK_FORMAT_B16G16R16G16_422_UNORM;
    case Format::B12X4G12X4_R12X4G12X4_422_UNORM_4PACK16: return VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16;
    case Format::B10X6G10X6_R10X6G10X6_422_UNORM_4PACK16: return VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16;
    case Format::B8G8_R8G8_422_UNORM: return VK_FORMAT_B8G8R8G8_422_UNORM;
    case Format::G16_B16_R16_3PLANE_444_UNORM: return VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM;
    case Format::G16_B16_R16_3PLANE_422_UNORM: return VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM;
    case Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: return VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16;
    case Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: return VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16;
    case Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: return VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16;
    case Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: return VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16;
    case Format::G16_B16_R16_3PLANE_420_UNORM: return VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM;
    case Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: return VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16;
    case Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: return VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16;
    case Format::G8_B8_R8_3PLANE_444_UNORM: return VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM;
    case Format::G8_B8_R8_3PLANE_422_UNORM: return VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM;
    case Format::G8_B8_R8_3PLANE_420_UNORM: return VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
    case Format::G16_B16R16_2PLANE_422_UNORM: return VK_FORMAT_G16_B16R16_2PLANE_422_UNORM;
    case Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: return VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16;
    case Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: return VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16;
    case Format::G16_B16R16_2PLANE_420_UNORM: return VK_FORMAT_G16_B16R16_2PLANE_420_UNORM;
    case Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: return VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16;
    case Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: return VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
    case Format::G8_B8R8_2PLANE_422_UNORM: return VK_FORMAT_G8_B8R8_2PLANE_422_UNORM;
    case Format::G8_B8R8_2PLANE_420_UNORM: return VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
    case Format::PVRTC1_4BPP_UNORM_BLOCK_IMG: return VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG;
    case Format::PVRTC1_4BPP_SRGB_BLOCK_IMG: return VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG;
    case Format::PVRTC1_2BPP_UNORM_BLOCK_IMG: return VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG;
    case Format::PVRTC1_2BPP_SRGB_BLOCK_IMG: return VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG;
    case Format::PVRTC2_4BPP_UNORM_BLOCK_IMG: return VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG;
    case Format::PVRTC2_4BPP_SRGB_BLOCK_IMG: return VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG;
    case Format::PVRTC2_2BPP_UNORM_BLOCK_IMG: return VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG;
    case Format::PVRTC2_2BPP_SRGB_BLOCK_IMG: return VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG;
    default: return VK_FORMAT_UNDEFINED;
    }
}

inline Format getRenderFormat(VkFormat format) noexcept {
    switch(format) {
    case VK_FORMAT_UNDEFINED: return Format::UNKNOWN;
    case VK_FORMAT_R4G4_UNORM_PACK8: return Format::G4R4_UNORM_PACK8;
    case VK_FORMAT_R4G4B4A4_UNORM_PACK16: return Format::A4B4G4R4_UNORM_PACK16;
    case VK_FORMAT_B4G4R4A4_UNORM_PACK16: return Format::A4R4G4B4_UNORM_PACK16;
    case VK_FORMAT_R5G6B5_UNORM_PACK16: return Format::B5G6R5_UNORM_PACK16;
    case VK_FORMAT_B5G6R5_UNORM_PACK16: return Format::R5G6B5_UNORM_PACK16;
    case VK_FORMAT_R5G5B5A1_UNORM_PACK16: return Format::A1B5G5R5_UNORM_PACK16;
    case VK_FORMAT_B5G5R5A1_UNORM_PACK16: return Format::A1R5G5B5_UNORM_PACK16;
    case VK_FORMAT_A1R5G5B5_UNORM_PACK16: return Format::B5G5R5A1_UNORM_PACK16;
    case VK_FORMAT_R8_UNORM: return Format::R8_UNORM;
    case VK_FORMAT_R8_SNORM: return Format::R8_SNORM;
    case VK_FORMAT_R8_USCALED: return Format::R8_USCALED;
    case VK_FORMAT_R8_SSCALED: return Format::R8_SSCALED;
    case VK_FORMAT_R8_UINT: return Format::R8_UINT;
    case VK_FORMAT_R8_SINT: return Format::R8_SINT;
    case VK_FORMAT_R8_SRGB: return Format::R8_SRGB;
    case VK_FORMAT_R8G8_UNORM: return Format::R8G8_UNORM;
    case VK_FORMAT_R8G8_SNORM: return Format::R8G8_SNORM;
    case VK_FORMAT_R8G8_USCALED: return Format::R8G8_USCALED;
    case VK_FORMAT_R8G8_SSCALED: return Format::R8G8_SSCALED;
    case VK_FORMAT_R8G8_UINT: return Format::R8G8_UINT;
    case VK_FORMAT_R8G8_SINT: return Format::R8G8_SINT;
    case VK_FORMAT_R8G8_SRGB: return Format::R8G8_SRGB;
    case VK_FORMAT_R8G8B8_UNORM: return Format::R8G8B8_UNORM;
    case VK_FORMAT_R8G8B8_SNORM: return Format::R8G8B8_SNORM;
    case VK_FORMAT_R8G8B8_USCALED: return Format::R8G8B8_USCALED;
    case VK_FORMAT_R8G8B8_SSCALED: return Format::R8G8B8_SSCALED;
    case VK_FORMAT_R8G8B8_UINT: return Format::R8G8B8_UINT;
    case VK_FORMAT_R8G8B8_SINT: return Format::R8G8B8_SINT;
    case VK_FORMAT_R8G8B8_SRGB: return Format::R8G8B8_SRGB;
    case VK_FORMAT_B8G8R8_UNORM: return Format::B8G8R8_UNORM;
    case VK_FORMAT_B8G8R8_SNORM: return Format::B8G8R8_SNORM;
    case VK_FORMAT_B8G8R8_USCALED: return Format::B8G8R8_USCALED;
    case VK_FORMAT_B8G8R8_SSCALED: return Format::B8G8R8_SSCALED;
    case VK_FORMAT_B8G8R8_UINT: return Format::B8G8R8_UINT;
    case VK_FORMAT_B8G8R8_SINT: return Format::B8G8R8_SINT;
    case VK_FORMAT_B8G8R8_SRGB: return Format::B8G8R8_SRGB;
    case VK_FORMAT_R8G8B8A8_UNORM: return Format::R8G8B8A8_UNORM;
    case VK_FORMAT_R8G8B8A8_SNORM: return Format::R8G8B8A8_SNORM;
    case VK_FORMAT_R8G8B8A8_USCALED: return Format::R8G8B8A8_USCALED;
    case VK_FORMAT_R8G8B8A8_SSCALED: return Format::R8G8B8A8_SSCALED;
    case VK_FORMAT_R8G8B8A8_UINT: return Format::R8G8B8A8_UINT;
    case VK_FORMAT_R8G8B8A8_SINT: return Format::R8G8B8A8_SINT;
    case VK_FORMAT_R8G8B8A8_SRGB: return Format::R8G8B8A8_SRGB;
    case VK_FORMAT_B8G8R8A8_UNORM: return Format::B8G8R8A8_UNORM;
    case VK_FORMAT_B8G8R8A8_SNORM: return Format::B8G8R8A8_SNORM;
    case VK_FORMAT_B8G8R8A8_USCALED: return Format::B8G8R8A8_USCALED;
    case VK_FORMAT_B8G8R8A8_SSCALED: return Format::B8G8R8A8_SSCALED;
    case VK_FORMAT_B8G8R8A8_UINT: return Format::B8G8R8A8_UINT;
    case VK_FORMAT_B8G8R8A8_SINT: return Format::B8G8R8A8_SINT;
    case VK_FORMAT_B8G8R8A8_SRGB: return Format::B8G8R8A8_SRGB;
    case VK_FORMAT_A8B8G8R8_UNORM_PACK32: return Format::R8G8B8A8_UNORM_PACK32;
    case VK_FORMAT_A8B8G8R8_SNORM_PACK32: return Format::R8G8B8A8_SNORM_PACK32;
    case VK_FORMAT_A8B8G8R8_USCALED_PACK32: return Format::R8G8B8A8_USCALED_PACK32;
    case VK_FORMAT_A8B8G8R8_SSCALED_PACK32: return Format::R8G8B8A8_SSCALED_PACK32;
    case VK_FORMAT_A8B8G8R8_UINT_PACK32: return Format::R8G8B8A8_UINT_PACK32;
    case VK_FORMAT_A8B8G8R8_SINT_PACK32: return Format::R8G8B8A8_SINT_PACK32;
    case VK_FORMAT_A8B8G8R8_SRGB_PACK32: return Format::R8G8B8A8_SRGB_PACK32;
    case VK_FORMAT_A2R10G10B10_UNORM_PACK32: return Format::B10G10R10A2_UNORM_PACK32;
    case VK_FORMAT_A2R10G10B10_SNORM_PACK32: return Format::B10G10R10A2_SNORM_PACK32;
    case VK_FORMAT_A2R10G10B10_USCALED_PACK32: return Format::B10G10R10A2_USCALED_PACK32;
    case VK_FORMAT_A2R10G10B10_SSCALED_PACK32: return Format::B10G10R10A2_SSCALED_PACK32;
    case VK_FORMAT_A2R10G10B10_UINT_PACK32: return Format::B10G10R10A2_UINT_PACK32;
    case VK_FORMAT_A2R10G10B10_SINT_PACK32: return Format::B10G10R10A2_SINT_PACK32;
    case VK_FORMAT_A2B10G10R10_UNORM_PACK32: return Format::R10G10B10A2_UNORM_PACK32;
    case VK_FORMAT_A2B10G10R10_SNORM_PACK32: return Format::R10G10B10A2_SNORM_PACK32;
    case VK_FORMAT_A2B10G10R10_USCALED_PACK32: return Format::R10G10B10A2_USCALED_PACK32;
    case VK_FORMAT_A2B10G10R10_SSCALED_PACK32: return Format::R10G10B10A2_SSCALED_PACK32;
    case VK_FORMAT_A2B10G10R10_UINT_PACK32: return Format::R10G10B10A2_UINT_PACK32;
    case VK_FORMAT_A2B10G10R10_SINT_PACK32: return Format::R10G10B10A2_SINT_PACK32;
    case VK_FORMAT_R16_UNORM: return Format::R16_UNORM;
    case VK_FORMAT_R16_SNORM: return Format::R16_SNORM;
    case VK_FORMAT_R16_USCALED: return Format::R16_USCALED;
    case VK_FORMAT_R16_SSCALED: return Format::R16_SSCALED;
    case VK_FORMAT_R16_UINT: return Format::R16_UINT;
    case VK_FORMAT_R16_SINT: return Format::R16_SINT;
    case VK_FORMAT_R16_SFLOAT: return Format::R16_SFLOAT;
    case VK_FORMAT_R16G16_UNORM: return Format::R16G16_UNORM;
    case VK_FORMAT_R16G16_SNORM: return Format::R16G16_SNORM;
    case VK_FORMAT_R16G16_USCALED: return Format::R16G16_USCALED;
    case VK_FORMAT_R16G16_SSCALED: return Format::R16G16_SSCALED;
    case VK_FORMAT_R16G16_UINT: return Format::R16G16_UINT;
    case VK_FORMAT_R16G16_SINT: return Format::R16G16_SINT;
    case VK_FORMAT_R16G16_SFLOAT: return Format::R16G16_SFLOAT;
    case VK_FORMAT_R16G16B16_UNORM: return Format::R16G16B16_UNORM;
    case VK_FORMAT_R16G16B16_SNORM: return Format::R16G16B16_SNORM;
    case VK_FORMAT_R16G16B16_USCALED: return Format::R16G16B16_USCALED;
    case VK_FORMAT_R16G16B16_SSCALED: return Format::R16G16B16_SSCALED;
    case VK_FORMAT_R16G16B16_UINT: return Format::R16G16B16_UINT;
    case VK_FORMAT_R16G16B16_SINT: return Format::R16G16B16_SINT;
    case VK_FORMAT_R16G16B16_SFLOAT: return Format::R16G16B16_SFLOAT;
    case VK_FORMAT_R16G16B16A16_UNORM: return Format::R16G16B16A16_UNORM;
    case VK_FORMAT_R16G16B16A16_SNORM: return Format::R16G16B16A16_SNORM;
    case VK_FORMAT_R16G16B16A16_USCALED: return Format::R16G16B16A16_USCALED;
    case VK_FORMAT_R16G16B16A16_SSCALED: return Format::R16G16B16A16_SSCALED;
    case VK_FORMAT_R16G16B16A16_UINT: return Format::R16G16B16A16_UINT;
    case VK_FORMAT_R16G16B16A16_SINT: return Format::R16G16B16A16_SINT;
    case VK_FORMAT_R16G16B16A16_SFLOAT: return Format::R16G16B16A16_SFLOAT;
    case VK_FORMAT_R32_UINT: return Format::R32_UINT;
    case VK_FORMAT_R32_SINT: return Format::R32_SINT;
    case VK_FORMAT_R32_SFLOAT: return Format::R32_SFLOAT;
    case VK_FORMAT_R32G32_UINT: return Format::R32G32_UINT;
    case VK_FORMAT_R32G32_SINT: return Format::R32G32_SINT;
    case VK_FORMAT_R32G32_SFLOAT: return Format::R32G32_SFLOAT;
    case VK_FORMAT_R32G32B32_UINT: return Format::R32G32B32_UINT;
    case VK_FORMAT_R32G32B32_SINT: return Format::R32G32B32_SINT;
    case VK_FORMAT_R32G32B32_SFLOAT: return Format::R32G32B32_SFLOAT;
    case VK_FORMAT_R32G32B32A32_UINT: return Format::R32G32B32A32_UINT;
    case VK_FORMAT_R32G32B32A32_SINT: return Format::R32G32B32A32_SINT;
    case VK_FORMAT_R32G32B32A32_SFLOAT: return Format::R32G32B32A32_SFLOAT;
    case VK_FORMAT_R64_UINT: return Format::R64_UINT;
    case VK_FORMAT_R64_SINT: return Format::R64_SINT;
    case VK_FORMAT_R64_SFLOAT: return Format::R64_SFLOAT;
    case VK_FORMAT_R64G64_UINT: return Format::R64G64_UINT;
    case VK_FORMAT_R64G64_SINT: return Format::R64G64_SINT;
    case VK_FORMAT_R64G64_SFLOAT: return Format::R64G64_SFLOAT;
    case VK_FORMAT_R64G64B64_UINT: return Format::R64G64B64_UINT;
    case VK_FORMAT_R64G64B64_SINT: return Format::R64G64B64_SINT;
    case VK_FORMAT_R64G64B64_SFLOAT: return Format::R64G64B64_SFLOAT;
    case VK_FORMAT_R64G64B64A64_UINT: return Format::R64G64B64A64_UINT;
    case VK_FORMAT_R64G64B64A64_SINT: return Format::R64G64B64A64_SINT;
    case VK_FORMAT_R64G64B64A64_SFLOAT: return Format::R64G64B64A64_SFLOAT;
    case VK_FORMAT_B10G11R11_UFLOAT_PACK32: return Format::R11G11B10_UFLOAT_PACK32;
    case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: return Format::R9G9B9E5_UFLOAT_PACK32;
    case VK_FORMAT_D16_UNORM: return Format::D16_UNORM;
    case VK_FORMAT_X8_D24_UNORM_PACK32: return Format::D24_UNORM_X8_TYPELESS_PACK32;
    case VK_FORMAT_D32_SFLOAT: return Format::D32_SFLOAT;
    case VK_FORMAT_S8_UINT: return Format::S8_UINT;
    case VK_FORMAT_D16_UNORM_S8_UINT: return Format::D16_UNORM_S8_UINT;
    case VK_FORMAT_D24_UNORM_S8_UINT: return Format::D24_UNORM_S8_UINT;
    case VK_FORMAT_D32_SFLOAT_S8_UINT: return Format::D32_SFLOAT_S8_UINT;
    case VK_FORMAT_BC1_RGB_UNORM_BLOCK: return Format::BC1_UNORM_BLOCK;
    case VK_FORMAT_BC1_RGB_SRGB_BLOCK: return Format::BC1_SRGB_BLOCK;
    case VK_FORMAT_BC1_RGBA_UNORM_BLOCK: return Format::BC1_RGBA_UNORM_BLOCK;
    case VK_FORMAT_BC1_RGBA_SRGB_BLOCK: return Format::BC1_RGBA_SRGB_BLOCK;
    case VK_FORMAT_BC2_UNORM_BLOCK: return Format::BC2_UNORM_BLOCK;
    case VK_FORMAT_BC2_SRGB_BLOCK: return Format::BC2_SRGB_BLOCK;
    case VK_FORMAT_BC3_UNORM_BLOCK: return Format::BC3_UNORM_BLOCK;
    case VK_FORMAT_BC3_SRGB_BLOCK: return Format::BC3_SRGB_BLOCK;
    case VK_FORMAT_BC4_UNORM_BLOCK: return Format::BC4_UNORM_BLOCK;
    case VK_FORMAT_BC4_SNORM_BLOCK: return Format::BC4_SNORM_BLOCK;
    case VK_FORMAT_BC5_UNORM_BLOCK: return Format::BC5_UNORM_BLOCK;
    case VK_FORMAT_BC5_SNORM_BLOCK: return Format::BC5_SNORM_BLOCK;
    case VK_FORMAT_BC6H_UFLOAT_BLOCK: return Format::BC6H_UFLOAT_BLOCK;
    case VK_FORMAT_BC6H_SFLOAT_BLOCK: return Format::BC6H_SFLOAT_BLOCK;
    case VK_FORMAT_BC7_UNORM_BLOCK: return Format::BC7_UNORM_BLOCK;
    case VK_FORMAT_BC7_SRGB_BLOCK: return Format::BC7_SRGB_BLOCK;
    case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: return Format::ETC2_R8G8B8_UNORM_BLOCK;
    case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: return Format::ETC2_R8G8B8_SRGB_BLOCK;
    case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: return Format::ETC2_R8G8B8A1_UNORM_BLOCK;
    case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: return Format::ETC2_R8G8B8A1_SRGB_BLOCK;
    case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: return Format::ETC2_R8G8B8A8_UNORM_BLOCK;
    case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: return Format::ETC2_R8G8B8A8_SRGB_BLOCK;
    case VK_FORMAT_EAC_R11_UNORM_BLOCK: return Format::EAC_R11_UNORM_BLOCK;
    case VK_FORMAT_EAC_R11_SNORM_BLOCK: return Format::EAC_R11_SNORM_BLOCK;
    case VK_FORMAT_EAC_R11G11_UNORM_BLOCK: return Format::EAC_R11G11_UNORM_BLOCK;
    case VK_FORMAT_EAC_R11G11_SNORM_BLOCK: return Format::EAC_R11G11_SNORM_BLOCK;
    case VK_FORMAT_ASTC_4x4_UNORM_BLOCK: return Format::ASTC_4x4_UNORM_BLOCK;
    case VK_FORMAT_ASTC_4x4_SRGB_BLOCK: return Format::ASTC_4x4_SRGB_BLOCK;
    case VK_FORMAT_ASTC_5x4_UNORM_BLOCK: return Format::ASTC_5x4_UNORM_BLOCK;
    case VK_FORMAT_ASTC_5x4_SRGB_BLOCK: return Format::ASTC_5x4_SRGB_BLOCK;
    case VK_FORMAT_ASTC_5x5_UNORM_BLOCK: return Format::ASTC_5x5_UNORM_BLOCK;
    case VK_FORMAT_ASTC_5x5_SRGB_BLOCK: return Format::ASTC_5x5_SRGB_BLOCK;
    case VK_FORMAT_ASTC_6x5_UNORM_BLOCK: return Format::ASTC_6x5_UNORM_BLOCK;
    case VK_FORMAT_ASTC_6x5_SRGB_BLOCK: return Format::ASTC_6x5_SRGB_BLOCK;
    case VK_FORMAT_ASTC_6x6_UNORM_BLOCK: return Format::ASTC_6x6_UNORM_BLOCK;
    case VK_FORMAT_ASTC_6x6_SRGB_BLOCK: return Format::ASTC_6x6_SRGB_BLOCK;
    case VK_FORMAT_ASTC_8x5_UNORM_BLOCK: return Format::ASTC_8x5_UNORM_BLOCK;
    case VK_FORMAT_ASTC_8x5_SRGB_BLOCK: return Format::ASTC_8x5_SRGB_BLOCK;
    case VK_FORMAT_ASTC_8x6_UNORM_BLOCK: return Format::ASTC_8x6_UNORM_BLOCK;
    case VK_FORMAT_ASTC_8x6_SRGB_BLOCK: return Format::ASTC_8x6_SRGB_BLOCK;
    case VK_FORMAT_ASTC_8x8_UNORM_BLOCK: return Format::ASTC_8x8_UNORM_BLOCK;
    case VK_FORMAT_ASTC_8x8_SRGB_BLOCK: return Format::ASTC_8x8_SRGB_BLOCK;
    case VK_FORMAT_ASTC_10x5_UNORM_BLOCK: return Format::ASTC_10x5_UNORM_BLOCK;
    case VK_FORMAT_ASTC_10x5_SRGB_BLOCK: return Format::ASTC_10x5_SRGB_BLOCK;
    case VK_FORMAT_ASTC_10x6_UNORM_BLOCK: return Format::ASTC_10x6_UNORM_BLOCK;
    case VK_FORMAT_ASTC_10x6_SRGB_BLOCK: return Format::ASTC_10x6_SRGB_BLOCK;
    case VK_FORMAT_ASTC_10x8_UNORM_BLOCK: return Format::ASTC_10x8_UNORM_BLOCK;
    case VK_FORMAT_ASTC_10x8_SRGB_BLOCK: return Format::ASTC_10x8_SRGB_BLOCK;
    case VK_FORMAT_ASTC_10x10_UNORM_BLOCK: return Format::ASTC_10x10_UNORM_BLOCK;
    case VK_FORMAT_ASTC_10x10_SRGB_BLOCK: return Format::ASTC_10x10_SRGB_BLOCK;
    case VK_FORMAT_ASTC_12x10_UNORM_BLOCK: return Format::ASTC_12x10_UNORM_BLOCK;
    case VK_FORMAT_ASTC_12x10_SRGB_BLOCK: return Format::ASTC_12x10_SRGB_BLOCK;
    case VK_FORMAT_ASTC_12x12_UNORM_BLOCK: return Format::ASTC_12x12_UNORM_BLOCK;
    case VK_FORMAT_ASTC_12x12_SRGB_BLOCK: return Format::ASTC_12x12_SRGB_BLOCK;
    case VK_FORMAT_G8B8G8R8_422_UNORM: return Format::G8B8_G8R8_422_UNORM;
    case VK_FORMAT_B8G8R8G8_422_UNORM: return Format::B8G8_R8G8_422_UNORM;
    case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: return Format::G8_B8_R8_3PLANE_420_UNORM;
    case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: return Format::G8_B8R8_2PLANE_420_UNORM;
    case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM: return Format::G8_B8_R8_3PLANE_422_UNORM;
    case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM: return Format::G8_B8R8_2PLANE_422_UNORM;
    case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM: return Format::G8_B8_R8_3PLANE_444_UNORM;
    case VK_FORMAT_R10X6_UNORM_PACK16: return Format::R10X6_UNORM_PACK16;
    case VK_FORMAT_R10X6G10X6_UNORM_2PACK16: return Format::R10X6G10X6_UNORM_2PACK16;
    case VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: return Format::R10X6G10X6B10X6A10X6_UNORM_4PACK16;
    case VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: return Format::G10X6B10X6_G10X6R10X6_422_UNORM_4PACK16;
    case VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: return Format::B10X6G10X6_R10X6G10X6_422_UNORM_4PACK16;
    case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: return Format::G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16;
    case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: return Format::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
    case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: return Format::G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16;
    case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: return Format::G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16;
    case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: return Format::G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16;
    case VK_FORMAT_R12X4_UNORM_PACK16: return Format::R12X4_UNORM_PACK16;
    case VK_FORMAT_R12X4G12X4_UNORM_2PACK16: return Format::R12X4G12X4_UNORM_2PACK16;
    case VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: return Format::R12X4G12X4B12X4A12X4_UNORM_4PACK16;
    case VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: return Format::G12X4B12X4_G12X4R12X4_422_UNORM_4PACK16;
    case VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: return Format::B12X4G12X4_R12X4G12X4_422_UNORM_4PACK16;
    case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: return Format::G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16;
    case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: return Format::G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16;
    case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: return Format::G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16;
    case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: return Format::G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16;
    case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: return Format::G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16;
    case VK_FORMAT_G16B16G16R16_422_UNORM: return Format::G16B16_G16R16_422_UNORM;
    case VK_FORMAT_B16G16R16G16_422_UNORM: return Format::B16G16_R16G16_422_UNORM;
    case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM: return Format::G16_B16_R16_3PLANE_420_UNORM;
    case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM: return Format::G16_B16R16_2PLANE_420_UNORM;
    case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM: return Format::G16_B16_R16_3PLANE_422_UNORM;
    case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM: return Format::G16_B16R16_2PLANE_422_UNORM;
    case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM: return Format::G16_B16_R16_3PLANE_444_UNORM;
    case VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: return Format::PVRTC1_2BPP_UNORM_BLOCK_IMG;
    case VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: return Format::PVRTC1_4BPP_UNORM_BLOCK_IMG;
    case VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: return Format::PVRTC2_2BPP_UNORM_BLOCK_IMG;
    case VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: return Format::PVRTC2_4BPP_UNORM_BLOCK_IMG;
    case VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: return Format::PVRTC1_2BPP_SRGB_BLOCK_IMG;
    case VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: return Format::PVRTC1_4BPP_SRGB_BLOCK_IMG;
    case VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: return Format::PVRTC2_2BPP_SRGB_BLOCK_IMG;
    case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: return Format::PVRTC2_4BPP_SRGB_BLOCK_IMG;
    default: return Format::UNKNOWN;
    }
}

}
